      SUBROUTINE  CHAREQ
      REAL*8  RMAX,RC,HC,H1,H2,ALP,WN,WN2,C,C2,FRQ,FRQ2,T,U,ENGY,DELTA
      REAL*8  A,F,Y
      COMMON/VALUE /MODE,IERROR,I,ISTEP,J,K,L,N,NSOL,ISUM,KMAX,
     1              NMAX,IBOTM,ITOP,LY,LD,ACR,ELLIP,
     2              RMAX,RC,HC,H1,H2,ALP,WN,WN2,C,C2,FRQ,FRQ2,T,
     3              U,ENGY,DELTA,
     4              A(6,6),F(20),Y(6)
      REAL*8  YN,YB,SUM,Q
      COMMON/SOL   /YN(6,1000),YB(6,3,20),SUM(20),Q(3,21),
     1              WNB(100),TT(100),CC(100),UU(100),ENG(100),ELL(100),
     2              AC(100)
C
C PURPOSE -   TO EVALUATE CHARACTERISTIC EQUATION
C INPUT -     K
C OUTPUT -    DELTA
C
      GO TO  (100,200,100,200,100,600),MODE
C
C LOVE WAVE TYPE
C
  100 CONTINUE
      DELTA=YB(2,1,K)
      GO TO  1000
C
C RAYLEIGH WAVE TYPE
C
  200 CONTINUE
      IF(NSOL-1)  100,100,210
C DETERMINANT OF A 2X2 MATRIX
  210 CONTINUE
      DELTA=YB(2,1,K)*YB(4,2,K)-YB(2,2,K)*YB(4,1,K)
      GO TO  1000
C
C SPHEROIDAL OSCILLATION
C
  600 CONTINUE
      IF(NSOL-2)  100,210,610
C DETERMINANT OF A 3X3 MATRIX
  610 CONTINUE
      DELTA=YB(2,1,K)*(YB(4,2,K)*YB(6,3,K)-YB(4,3,K)*YB(6,2,K))
     1     +YB(2,2,K)*(YB(4,3,K)*YB(6,1,K)-YB(4,1,K)*YB(6,3,K))
     2     +YB(2,3,K)*(YB(4,1,K)*YB(6,2,K)-YB(4,2,K)*YB(6,1,K))
      GO TO  1000
C
C EXIT
C
 1000 CONTINUE
      RETURN
      END
